const koa = require('koa'),
webpack = require('webpack'),
koaBody = require('koa-body'),
koaStatic = require('koa-static'),
mount = require('koa-mount'),
Pug = require('koa-pug'),
app = new koa(),
pug = new Pug({
  viewPath: 'view',
  basedir: './',
	noCache:true,
	pretty: false
});
var
PageRouter = require('./router/pageRouter'),
PanelRouter=require('./router/panelRouter'),
ApiRouter=require('./router/ApiRouter');

pug.use(app);

app
  .use(koaBody())
  .use(PageRouter.routes())
  .use(PageRouter.allowedMethods())
  .use(mount('/panel',PanelRouter.routes()))
  .use(PanelRouter.allowedMethods())
  .use(mount('/data-api',ApiRouter.routes()))
  .use(ApiRouter.allowedMethods())
	.use(mount('/static',koaStatic('./static')))
	.use(mount('/dist',koaStatic('./dist')))
  .listen(1200);

